Integrand size = 33, antiderivative size = 612 \[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \arctan \left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {b \text {arctanh}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \text {arctanh}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e} \]
[Out]
Time = 24.42 (sec) , antiderivative size = 612, normalized size of antiderivative = 1.00, number of steps used = 17, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {3781, 6857, 746, 857, 635, 212, 738, 1004, 1050, 1044, 211, 214} \[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \arctan \left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-\left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}+\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \text {arctanh}\left (\frac {\left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \tan (d+e x)+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {b \text {arctanh}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e} \]
[In]
[Out]
Rule 211
Rule 212
Rule 214
Rule 635
Rule 738
Rule 746
Rule 857
Rule 1004
Rule 1044
Rule 1050
Rule 3781
Rule 6857
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{x^2 \left (1+x^2\right )} \, dx,x,\tan (d+e x)\right )}{e} \\ & = \frac {\text {Subst}\left (\int \left (\frac {\sqrt {a+b x+c x^2}}{x^2}+\frac {\sqrt {a+b x+c x^2}}{-1-x^2}\right ) \, dx,x,\tan (d+e x)\right )}{e} \\ & = \frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{x^2} \, dx,x,\tan (d+e x)\right )}{e}+\frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{-1-x^2} \, dx,x,\tan (d+e x)\right )}{e} \\ & = -\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}+\frac {\text {Subst}\left (\int \frac {b+2 c x}{x \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 e}+\frac {\text {Subst}\left (\int \frac {a-c+b x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e}-\frac {c \text {Subst}\left (\int \frac {1}{\sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e} \\ & = -\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}+\frac {b \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 e}+\frac {c \text {Subst}\left (\int \frac {1}{\sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e}-\frac {(2 c) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}-\frac {\text {Subst}\left (\int \frac {b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )-b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 \sqrt {a^2+b^2-2 a c+c^2} e}+\frac {\text {Subst}\left (\int \frac {b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )+b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 \sqrt {a^2+b^2-2 a c+c^2} e} \\ & = -\frac {\sqrt {c} \text {arctanh}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}-\frac {b \text {Subst}\left (\int \frac {1}{4 a-x^2} \, dx,x,\frac {2 a+b \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {(2 c) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {\left (b \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )-b x^2} \, dx,x,\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {\left (b \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )-b x^2} \, dx,x,\frac {-b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e} \\ & = \frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \arctan \left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {b \text {arctanh}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \text {arctanh}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.22 (sec) , antiderivative size = 261, normalized size of antiderivative = 0.43 \[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=-\frac {\frac {b \text {arctanh}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {a}}-i \sqrt {a-i b-c} \text {arctanh}\left (\frac {2 a-i b+(b-2 i c) \tan (d+e x)}{2 \sqrt {a-i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )+i \sqrt {a+i b-c} \text {arctanh}\left (\frac {2 a+i b+(b+2 i c) \tan (d+e x)}{2 \sqrt {a+i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )+2 \cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{2 e} \]
[In]
[Out]
Timed out.
hanged
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 4592 vs. \(2 (552) = 1104\).
Time = 1.05 (sec) , antiderivative size = 9221, normalized size of antiderivative = 15.07 \[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\int \sqrt {a + b \tan {\left (d + e x \right )} + c \tan ^{2}{\left (d + e x \right )}} \cot ^{2}{\left (d + e x \right )}\, dx \]
[In]
[Out]
\[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\int { \sqrt {c \tan \left (e x + d\right )^{2} + b \tan \left (e x + d\right ) + a} \cot \left (e x + d\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\int { \sqrt {c \tan \left (e x + d\right )^{2} + b \tan \left (e x + d\right ) + a} \cot \left (e x + d\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx=\int {\mathrm {cot}\left (d+e\,x\right )}^2\,\sqrt {c\,{\mathrm {tan}\left (d+e\,x\right )}^2+b\,\mathrm {tan}\left (d+e\,x\right )+a} \,d x \]
[In]
[Out]